﻿@namespace MudBlazor
@inherits MudBooleanInput<T>
@typeparam T

<label class="@Classname" style="@Style" id="@_elementId" @onkeydown="HandleKeyDown">
    <span tabindex="0" class="@CheckBoxClassname">
        @*note: stopping the click propagation is important here. otherwise checking the checkbox results in click events on its parent (i.e. table row), which is generally not what you would want*@
        <input tabindex="-1" @attributes="UserAttributes" type="checkbox"  class="mud-checkbox-input" checked="@BoolValue" @onchange="@OnChange" disabled="@Disabled" @onclick:stopPropagation="@StopClickPropagation" @onclick:preventDefault="@ReadOnly"/>
        <MudIcon Icon="@GetIcon()" Size="@Size"/>
    </span>
    @if (!String.IsNullOrEmpty(Label))
    {
        <MudText>@Label</MudText>
    }
    @if (ChildContent != null)
    {
        <MudText>
            @ChildContent
        </MudText>
    }
</label>
